package com.jg.poiet.excel.po;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.util.ArrayList;
import java.util.List;

public class IWorkBook {

    private List<ISheet> sheetList = new ArrayList<>();

    public IWorkBook(XSSFWorkbook workbook) {
        for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
            sheetList.add(new ISheet(workbook, workbook.getSheetAt(i)));
        }
    }

    public IWorkBook(HSSFWorkbook workbook) {
        for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
            sheetList.add(new ISheet(workbook, workbook.getSheetAt(i)));
        }
    }

    public List<ISheet> getSheetList() {
        return sheetList;
    }

    public void setSheetList(List<ISheet> sheetList) {
        this.sheetList = sheetList;
    }
}
